<template>
	<view v-if="pageShow">
		<!-- <u-swiper :list="list1" height="300" round="0"></u-swiper> -->
		<view class="" style="padding-bottom: 100rpx;">
			<view class="content mainpadding ffffff">
				<view class="titletext bold hei_text pdl">{{dataAll.name}}</view>
				<view class="flexbetween margin_top">
					<view class="flexleft">
						<view class="xiaoyuan"></view>
						<view class="titletext bold hei_text">活动时间</view>
					</view>
					<view class="huang_text bold flexleft">
						<view class="">距离结束还剩：</view>
						<text class="time" style="color: #28C445;">{{DifferenceTimer(dataAll.end_time*1000,Number(new Date()))}}天</text>
					</view>
				</view>
				<view class="mainpadding">
					<view class="flexleft">
						<u-icon name="clock" color="#999" size="20"></u-icon>
						<view class="hei_text main_size bold mgrgin_left1">开始：{{dataAll.start_time_text}}</view>
					</view>
					<view class="flexleft margin_top">
						<u-icon name="clock" color="#999" size="20"></u-icon>
						<view class="hei_text main_size bold mgrgin_left1">结束：{{dataAll.end_time_text}}</view>
					</view>
					<view class="flexleft margin_top">
						<u-icon name="level" color="#999" size="20"></u-icon>
						<view class="hei_text main_size bold mgrgin_left1">达标积分：{{dataAll.db_score}}</view>
					</view>
					<view class="flexleft margin_top">
						<u-icon name="level" color="#999" size="20"></u-icon>
						<view class="hei_text main_size bold mgrgin_left1">已完积分：{{dataAll.get_score}}</view>
					</view>
					<view class="flexleft margin_top">
						<u-icon name="integral" color="#999" size="20"></u-icon>
						<view class="hei_text main_size bold mgrgin_left1">成长值：{{dataAll.rate}}%</view>
					</view>
				</view>
				<view class="hei_text main_size bold mgrgin_left1">{{dataAll.notes}}</view>
				<!-- <view class="margin_top" v-if="dataAll.activitygoods.length">
					<view class="flexleft">
						<view class="xiaoyuan"></view>
						<view class="titletext bold hei_text">商品信息</view>
					</view>
					<view class="flexleft mainpadding" v-for="item in dataAll.activitygoods" :key="item.id">
						<image :src="item.goods.image_text" mode="" class="leftimage margin_right"></image>
						<view class="flexcolumn">
							<view class="hei_text titletext bold xiankuan">{{item.goods.name}}</view>
							<view class="xiaohui" v-show="item.join_goods_unit==1">{{item.goods.biggoodsunit.name}}</view>
							<view class="xiaohui" v-show="item.join_goods_unit==2">{{item.goods.middlegoodsunit.name}}</view>
							<view class="xiaohui" v-show="item.join_goods_unit==3">{{item.goods.smallgoodsunit.name}}</view>
							<view class="flexbetween" style="width: 100%;">
								<view class="hong_text bold main_size" v-show="item.join_goods_unit==1">￥{{item.goods.biggoodsunit.priceinfo.prev_xs_price}}</view>
								<view class="hong_text bold main_size" v-show="item.join_goods_unit==2">￥{{item.goods.middlegoodsunit.priceinfo.prev_xs_price}}</view>
								<view class="hong_text bold main_size" v-show="item.join_goods_unit==3">￥{{item.goods.smallgoodsunit.priceinfo.prev_xs_price}}</view>
								<view class="hong_text bold main_size">*{{item.num}}</view>
							</view>
						</view>
					</view>
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	import httpRequest from '@/commonFun/httpRequest.js'
	export default {
		data() {
			return {
				dataAll:{},
				pageShow:false
			}
		},
		onLoad() {
			this.huodong()
		},
		methods: {
			DifferenceTimer(now,before){
				let num_day = (Number(now) - Number(before)) / (1000*60*60*24);
				return num_day.toFixed(0)
			},
			huodong() {
				httpRequest.request('/customapi/user/activity1Detail', 'GET', {}).then(res => {
					if (res.code == 1) {
						this.dataAll = res.data;
						this.pageShow = true
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.btn {
		padding: 20rpx 40rpx;
		border-radius: 50rpx;
		color: #fff;
		background-color: #ffaf44;
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
	}

	.flexcolumn {
		display: flex;
		justify-content: space-between;
		align-items: flex-start;
		height: 130rpx;
		width: 100%;
	}

	.leftimage {
		width: 130rpx;
		height: 130rpx;
		min-width: 130rpx;
		max-width: 130rpx;
		border-radius: 10rpx;
	}

	.xiaoyuan {
		width: 20rpx;
		height: 20rpx;
		background-color: #ffaf44;
		border-radius: 50rpx;
		margin-right: 10rpx;
	}

	// .content {
	// 	// border-radius: 30rpx 30rpx 0 0;
	// 	position: relative;
	// 	top: -80rpx;
	// }

	.titletext {
		font-size: 32rpx;
	}

	.mgrgin_left1 {
		margin-left: 10rpx;
	}
</style>